//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
package org.netbeans.lib.awtextra;

import java.awt.Dimension;
import java.awt.Point;
import java.io.Serializable;

public class AbsoluteConstraints
        implements Serializable {

    public AbsoluteConstraints(Point pos) {
        this(pos.x, pos.y);
    }

    public AbsoluteConstraints(int x, int y) {
        width = -1;
        height = -1;
        this.x = x;
        this.y = y;
    }

    public AbsoluteConstraints(Point pos, Dimension size) {
        width = -1;
        height = -1;
        x = pos.x;
        y = pos.y;
        if (size != null) {
            width = size.width;
            height = size.height;
        }
    }

    public AbsoluteConstraints(int x, int y, int width, int height) {
        this.width = -1;
        this.height = -1;
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public String toString() {
        return super.toString() + " [x=" + x + ", y=" + y + ", width=" + width + ", height=" + height + "]";
    }
    static final long serialVersionUID = 0x490476a535ef832eL;
    public int x;
    public int y;
    public int width;
    public int height;
}
